package zdsoft.nbfsc.task;

import sense.vitality.ioc.SenseInjection;
import sense.vitality.protocol.Stuff;
import sense.vitality.security.Authentication;
import sense.vitality.security.Passport;
import sense.vitality.task.IntellTask;

import sense.vitality.text.Result;
import sense.vitality.verify.Parameter;

/**
 *
 * @author elegance
 */
public class LogoutTask extends IntellTask {

    @SenseInjection
    private Authentication authentication;

    @Override
    protected Stuff execute(Stuff request) {
        Param param = request.getParameter();
        Result rst = authentication.logout(param.getPassport());
        return request.instanceResponse(rst);
    }

    public static class Param extends Parameter {

        private Passport passport;

        public Passport getPassport() {
            return passport;
        }

        public void setPassport(Passport passport) {
            this.passport = passport;
        }
    }

}
